package user

import (
	"context"

	"gitee.com/shiwjlinux/vblog01/common"
)

const AppName = "user"

type Service interface {
	CreateUser(context.Context, *CreateUserRequest) (*User, error)
	QueryUser(context.Context, *QueryUserRequest) (*UserSet, error)
}

// 创建一个新的QueryUserRequest实例
func NewQueryUserRequest() *QueryUserRequest {
	// 返回一个新的QueryUserRequest实例，其中包含一个common.NewPageRequest()实例
	return &QueryUserRequest{
		PageRequest: common.NewPageRequest(),
	}
}

func QueryUserByUsername(username string) *QueryUserRequest {
	return &QueryUserRequest{
		Username:    username,
		PageRequest: common.NewPageRequest(),
	}
}

type QueryUserRequest struct {
	Username string
	*common.PageRequest
}
